package com.lanyun.interceptor;/**
 * @author zhy
 * @date 2021/1/14 - 10:50
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**

 @ClassName LoginConfig
 @Description xxx
 @Author zhy
 @Date 2021/1/14 - 10:50
 @Version 1.0
 **/
@Configuration
public class LoginConfig implements WebMvcConfigurer {
    public static final String SESSION_KEY = "loginer";

    @Autowired
    private URLInterceptor urlInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptor = registry.addInterceptor(urlInterceptor);
        interceptor.addPathPatterns("/**").excludePathPatterns("/","","/login","/css/**","/products/black/**","/products/logo/**","/js/**","/images/**","/assets/**","/font/**","/products/**","/Widget/**");
    }

   /* @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");

        WebMvcConfigurer.super.addResourceHandlers(registry);
    }*/
}
